﻿#include "pch.h"
#include "Chapter.h"
#include "Chapter.g.cpp"
#include "Utils.h"


namespace winrt::NovelReader::implementation
{
    Chapter::Chapter()
        : Chapter(L"", L"", 0)
    {
    }

    Chapter::Chapter(hstring const& title, hstring const& text, int32_t index)
        : m_title {title}
        , m_text {text}
        , m_index {index}
    {
    }

    hstring Chapter::Title()
    {
        return m_title; 
    }

    void Chapter::Title(hstring const& value)
    {
        if (value != m_title) {
            m_title = value;
        }
    }

    hstring Chapter::Text()
    {
        return m_text; 
    }

    void Chapter::Text(hstring const& value)
    {
        if (value != m_text) {
            m_text = value;
        }
    }

    int32_t Chapter::Index() const
    {
        return m_index; 
    }

    void Chapter::Index(int32_t const& value)
    {
        m_index = value; 
    }
}
